<template>
  <div class="pp_top text-center">
    <span class="glyphicon glyphicon-chevron-left back pull-left" @click="goback()" v-if="showback">返回</span>
    <span class="pp_title">{{toptitle}}<span v-if="showback">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span>
  </div>
</template>
<script>
  export default {
    title: 'TOP',
    data () {
      return {
        toptitle: this.toptext
      }
    },
    props: {
      toptext: {
        type: String,
        default: '用户操作'
      },
      showback: {
        type: Boolean,
        default: true
      }
    },
    methods: {
      goback () {
        console.log('33333')
        this.$dispatch('returnPage')
      }
    }
  }
</script>
<style>
  .pp_top {
    width: 100%;
    height: 55px;
    background-color: #304A66;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
  }
  .pp_title {
    font-family: '微软雅黑';
    font-size: 22px;
    color: white;
    font-weight: 546;
    line-height: 55px;
  }
  .back {
    position: relative;
    top: 27px;
    left: 5px;
    color: white;
    font-size: 14px;
  }
</style>
